import axios from '@/libs/api.request'

export class SysDataPermissionApi {
  static get (path, params = {}) {
    return request.get(path, createGETParams(params))
  }

  static post (path, params = {}) {
    return request.post(path, params)
  }

  // 客户列表
  static getCustomerList (params) {
    return axios.request({
      url: '/SysDataPermission/GetCustomerList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 客户名称列表
  static getCustomerNameList (params) {
    return axios.request({
      url: '/SysDataPermission/GetCustomerNameList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 分页查询客户数据权限详情列表
  static getCustomerPermissionList (params) {
    return axios.request({
      url: '/SysDataPermission/GetCustomerPermissionList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 数据权限账号列表
  static getUserList (params) {
    return axios.request({
      url: '/SysDataPermission/GetUserList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 数据权限账号名称列表
  static getUserNameList (params) {
    return axios.request({
      url: '/SysDataPermission/GetUserNameList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 分页查询账号数据权限详情列表
  static getUserPermissionList (params) {
    return axios.request({
      url: '/SysDataPermission/GetUserPermissionList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 获取批量【添加|删除】数据权限页面数据源
  static getBatchSetPermission (params) {
    return axios.request({
      url: '/SysDataPermission/GetBatchSetPermission',
      method: 'get',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 批量添加或删除权限
  static batchSetPermission (params) {
    return axios.request({
      url: '/SysDataPermission/BatchSetPermission',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 复制其他账号权限
  static batchCopyUserPermission (params) {
    return axios.request({
      url: '/SysDataPermission/BatchCopyUserPermission',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 复制其他账号权限
  static batchCopyUserPermission (params) {
    return axios.request({
      url: '/SysDataPermission/BatchCopyUserPermission',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 复制其他客户权限
  static batchCopyCustomerPermission (params) {
    return axios.request({
      url: '/SysDataPermission/BatchCopyCustomerPermission',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }
}
